package cn.chenfeifx.core.controls;

import cn.chenfeifx.core.controls.skins.CFDirectoryChooserSkin;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.scene.control.Control;
import javafx.scene.control.Skin;

import java.io.File;

public class CFDirectoryChooser extends Control {

    private final ObjectProperty<File> file = new SimpleObjectProperty<>();

    public CFDirectoryChooser() {
        initialize();
    }

    private void initialize() {
    }

    public ObjectProperty<File> fileProperty() {
        return file;
    }

    public File getFile() {
        return file.get();
    }

    public void setFile(File file) {
        this.file.set(file);
    }

    @Override
    protected Skin<?> createDefaultSkin() {
        return new CFDirectoryChooserSkin(this);
    }
}
